#!/bin/bash

set -e

echo "[*] Pulling curl image..."
docker pull curlimages/curl:latest

echo "[*] Creating attacker and victim pods..."
kubectl apply -f attacker.yaml
kubectl apply -f victim.yaml

echo "[*] Waiting 20s for pods' creation..."
sleep 20

echo "[*] Reading attacker's log..."
kubectl logs attacker

echo "[*] Trying to curl http://example.com in victim..."
kubectl exec -it victim curl http://example.com